<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>个人中心</title>
		<link rel="stylesheet" type="text/css" href="css/index.css" />
		<!-- 引入样式 -->
		<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/vant@1.6/lib/index.css">
		<!-- 引入组件 -->
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
		<script src="https://cdn.jsdelivr.net/npm/vant@1.6/lib/vant.min.js"></script>
	</head>
	<body>
		<div id="app">
			<!-- 头部 -->
			<van-row class="S_title">
				<van-col span="6">
					<img  v-model="imgUrl" :src="imgUrl" onerror="onerror=null;src='img/PingTouGe.jpg'">
					
				</van-col>
				<van-col span="6" v-if="Islogin" class="S_nickname">{{NickName}}</van-col>
				<van-col span="6" v-else class="S_nickname">未登录</van-col>
			</van-row>
			<!-- 内容 -->
			<van-row class="S_van_row">
				<van-col span="6" align="center">
					<div @click="skip('obligation')">
						<van-icon name="shopping-cart-o" size="28px" />
						<div class="S_state">待付款</div>
					</div>
				</van-col>
				<van-col span="6" align="center">
					<div @click="skip('take')">
						<van-icon name="todo-list-o" size="28px" />
						<div class="S_state">待收货</div>
					</div>
				</van-col>
				<van-col span="6" align="center">
					<div @click="skip('comment')">
						<van-icon name="comment-o" size="28px" />
						<div class="S_state">待评论</div>
					</div>
				</van-col>
				<van-col span="6" align="center">
					<div @click="skip('indent')">
						<van-icon name="orders-o" size="28px" />
						<div class="S_state">我的订单</div>
					</div>
				</van-col>
			</van-row>
			<van-cell-group>
				<van-cell title="个人资料" icon="user-o" is-link @click="skip('profile')"></van-cell>
				<van-cell title="收货地址" icon="location-o" is-link @click="skip('site')"></van-cell>
				<van-cell title="我的收藏" icon="like-o" is-link @click="skip('collect')"></van-cell>
			</van-cell-group>
			<van-cell-group class="S_set">
				<van-cell title="设置" icon="setting-o" is-link @click="skip('setting')"></van-cell>
			</van-cell-group>
	</body>
	<script src="js/ajax.js"></script>
	<script src="html5plus://ready"></script>
	<script>
		var userData1 = JSON.parse(localStorage.getItem("userData1"));
		var app = new Vue({
			el: "#app",
			data: {
				NickName:"",
				imgUrl:"",
				Islogin:false,
				active:3
			},
			methods: {
				skip(value){
					if(localStorage.getItem('Key') != null){
						plus.webview.show(plus.webview.create(value + ".html",value),"slide-in-left");
					}else{
						plus.webview.show(plus.webview.create("login.html","login"),"slide-in-bottom");
					}
				}
			},
			mounted(){
				if(localStorage.getItem('Key') != null){
					this.Islogin = true
					this.NickName = userData1.UserData.NickName;
					this.imgUrl = userData1.UserData.AvatarImage;
				}
			}
		})
	</script>
</html>
